import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.Scanner;

/**
 * @Author admin
 * @Date 2019/3/29 8:26
 */
public class Test1 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n=in.nextInt();
        int sum=0;
        System.out.println("请输入裁判个数");
        ArrayList arrayList = new ArrayList();
        System.out.println("请输入各裁判的分数");
        for (int i=0;i<n;i++){
            int cut = in.nextInt();
            arrayList.add(cut);
        }
        Collections.sort(arrayList);
        System.out.println("去掉一个最高分"+arrayList.get(arrayList.size()-1));
        arrayList.remove(arrayList.size()-1);
        System.out.println("去掉一个最低分"+arrayList.get(0));
        arrayList.remove(0);
        for (int i=0;i<n-2;i++){
            /*元素放入集合后，集合会忘记元素的类型，都当成Object*/
            int j= (int) arrayList.get(i);
            sum=sum+j;
        }
        System.out.println("选手最后得分"+(sum*1.0)/(n-2));

    }
}
